<!--  -->
<template>
  <div class="rights flex flex-v flex-align-center container">
    <image :src="roleType ? personRightsImgSrc : companyRightsImgSrc" mode="widthFix"></image>
  </div>
</template>

<script>
import { isPersonRoleType } from '@/utils/common'
export default {
	data() {
		return {
			userInfo: {},
			roleType: 0, // 0: 企业，1:个人
			isVip: false,
			personRightsImgSrc: this.$constant.imgUrl + 'vip/person-all-rights.png',
			companyRightsImgSrc: this.$constant.imgUrl + 'vip/company-all-rights.png'
		}
	},

	onLoad() {
		this.getRoleType()
	},

	methods: {
		// 判断用户角色类型（1:个人 || 0:企业）
		getRoleType() {
			this.userInfo = this.$store.state.user.user
			if (isPersonRoleType(this.userInfo.role_id)) {
				this.roleType = 1
			} else {
				this.roleType = 0
			}
		}
	}
}

</script>
<style lang='scss' scoped>
.rights {
  width: 100%;
  background: #f5f5f5;
  padding-top: 20px;
  img {
    width: 670px;
  }
}
</style>
